<?php

namespace App\Filament\User\Widgets;

use Filament\Widgets\StatsOverviewWidget as BaseWidget;
use Filament\Widgets\StatsOverviewWidget\Stat;
use Filament\Facades\Filament;

class StatsOverview extends BaseWidget
{
    protected function getStats(): array
    {
        $user = Filament::auth()->getUser();
        return [
            Stat::make('账号余额', '¥ '.number_format($user->balance))
                ->description('当前账号余额')
                ->descriptionIcon('heroicon-m-currency-dollar'),
            Stat::make('我的工程', '0')
                ->description('账号里面的余额')
                ->descriptionIcon('heroicon-m-arrow-trending-down'),
            Stat::make('我的推荐', '0')
                ->description('当前推荐的人数')
                ->descriptionIcon('heroicon-m-arrow-trending-down'),
            Stat::make('我的收藏', '0')
                ->description('我收藏的组件')
                ->descriptionIcon('heroicon-m-arrow-trending-down'),
        ];
    }

    protected function getColumns(): int
    {
        return 2; // TODO: Change the autogenerated stub
    }
}
